def Cal(length, num):
	length = length - 2
	if length < 0: length = 0
#	print 'cal', locals(), num*10**length
	return num*10**length 

def Cal1(num):
#	print 'cal1 start', locals()
	s = str(num)
	if s[0]=='0': return 0
	ans = Cal(len(s), int(s[0])-1)
	ans += (int(s[1:-1])+1) if len(s)>2 else 1
	if s[0]>s[-1]: ans -= 1 
#	print 'cal1', locals(), ans
	return ans

def GetResult(l, r):
	ans = 0
	l1 = len(str(l))
	l2 = len(str(r))
	if str(l)[-1]=='0': l += 1
	if l1 == l2: return Cal1(r) - Cal1(l-1) 
	for i in range(l1+1, l2):
		ans += Cal(i, 9)
	return ans + Cal(l1, 9) - Cal1(l-1) + Cal1(r)

try:
	while True:
		l,r = map(int, raw_input().split())
		print GetResult(l, r)
except Exception,e:
	pass
